package com.service.totalauth.service.impl;

import com.service.totalauth.entity.ProgrammeApiBind;
import com.service.totalauth.dao.ProgrammeApiBindDao;
import com.service.totalauth.service.ProgrammeApiBindService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (ProgrammeApiBind)表服务实现类
 *
 * @author makejava
 * @since 2021-12-03 09:38:51
 */
@Service("programmeApiBindService")
public class ProgrammeApiBindServiceImpl implements ProgrammeApiBindService {
    @Resource
    private ProgrammeApiBindDao programmeApiBindDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public ProgrammeApiBind queryById(String id) {
        return this.programmeApiBindDao.queryById(id);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<ProgrammeApiBind> queryAllByLimit(int offset, int limit) {
        return this.programmeApiBindDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param programmeApiBind 实例对象
     * @return 实例对象
     */
    @Override
    public ProgrammeApiBind insert(ProgrammeApiBind programmeApiBind) {
        this.programmeApiBindDao.insert(programmeApiBind);
        return programmeApiBind;
    }

    /**
     * 修改数据
     *
     * @param programmeApiBind 实例对象
     * @return 实例对象
     */
    @Override
    public ProgrammeApiBind update(ProgrammeApiBind programmeApiBind) {
        this.programmeApiBindDao.update(programmeApiBind);
        return this.queryById(programmeApiBind.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(String id) {
        return this.programmeApiBindDao.deleteById(id) > 0;
    }

    @Override
    public int insertBatch(List<ProgrammeApiBind> qyProgrammeApiBindList) {
        return programmeApiBindDao.insertBatch(qyProgrammeApiBindList);
    }

    @Override
    public void deleteByBatchId(List<String>  programmeApiBindId) {
        programmeApiBindDao.deleteByBatchId(programmeApiBindId);
    }

    @Override
    public List<ProgrammeApiBind> queryAll(ProgrammeApiBind programmeApiBind) {
        return programmeApiBindDao.queryAll(programmeApiBind);
    }

    @Override
    public void insertOrUpdateBatch(List<ProgrammeApiBind> programmeApiBindList1) {
        programmeApiBindDao.insertOrUpdateBatch(programmeApiBindList1);
    }
}
